interface MenuButton {
	top: number
	left: number
	right: number
	bottom: number
	width: number
	height: number
}

interface SafeArea {
	bottom: number
	height: number
	left: number
	right: number
	top: number
	width: number
}

interface SafeAreaInsets {
	top: number
	bottom: number
	left: number
	right: number
}

interface MpWxPos {
	statusBarHeight: number // 状态栏高度
	navBarHeight: number // 导航栏高度
	menuButton: MenuButton // 胶囊按钮信息
	menuButtonBottomGap: number // 胶囊按钮底部距离
	headerHeight: number // 顶部高度
	screenTop: number // 屏幕顶部高度
	screenWidth: number // 屏幕宽度
	screenHeight: number // 屏幕高度
	windowTop: number // 窗口顶部高度
	windowBottom: number // 窗口底部高度
	windowWidth: number // 窗口宽度
	windowHeight: number // 窗口高度
	safeArea: SafeArea | null // 安全区域
	safeAreaInsets: SafeAreaInsets | null // 安全区域内边距
	logoLeft: number // logo左边距
	logoHeight: number
	logoUrl: string // logo地址
}

export default {
	namespaced: true, // 开启命名空间
	state: {
		mpWxPos: <MpWxPos>{
			statusBarHeight: 0, // 状态栏高度
			navBarHeight: 0, // 导航栏高度
			menuButton: {
				top: 0,
				left: 0,
				right: 0,
				bottom: 0,
				width: 0,
				height: 0
			},
			menuButtonBottomGap: 0,
			headerHeight: 0,
			screenTop: 0,
			screenWidth: 0,
			screenHeight: 0,
			windowTop: 0,
			windowBottom: 0,
			windowWidth: 0,
			windowHeight: 0,
			safeArea: {
				top: 0,
				bottom: 0,
				left: 0,
				right: 0,
				width: 0,
				height: 0
			},
			safeAreaInsets: {
				top: 0,
				bottom: 0,
				left: 0,
				right: 0
			},
			logoLeft: 0,
			logoHeight: 0,
			logoUrl: ''
		}
	},
	getters: {
		getMpWxPos: (state) => {
			return state.mpWxPos
		}
	},
	mutations: {
		updateMpWxPos(state, newMpWxPos) {
			state.mpWxPos = Object.assign(state.mpWxPos, newMpWxPos)
			console.log('updatedMpWxPos:', newMpWxPos)
		}
	},
	actions: {}
}
